﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MyProject.Tools.Tools
{
    public partial class GetQRCode : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_QRcode_Click(object sender, EventArgs e)
        {
            string data = this.txtbx_data.Text;
            string output = this.ddl_output.SelectedItem.Text;
            string error = this.ddl_error.SelectedValue;
            string type = this.ddl_type.SelectedIndex.ToString();
            string margion = this.ddl_margin.SelectedIndex.ToString();
            string size = this.ddl_size.SelectedItem.Text;


            string url = "http://tool.oschina.net/action/qrcode/generate?data={0}&output=image%2F{1}&error={2}&type={3}&margin={4}&size={5}";

            url = string.Format(url, data, output, error, type, margion, size);

            this.Image_QR.ImageUrl = url;
        }
    }
}